<template>
    <view :style="themeColor">
        <view class="page" >
    <view class="flex benben-position-layout flex flex-wrap align-center orderSure_flex_0"    :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
            <view   class='flex flex-wrap align-center justify-between flex-sub orderSure_fd0_0'      >
            <view   class='flex flex-wrap align-center'   @tap.stop="handleJumpDiy" data-type="back" data-url="1"   >
        <text class='fu-iconfont2  orderSure_fd0_0_c0_c0'  >&#xE794;</text>
</view>
    <view   class='flex flex-wrap align-center'      >
        <text class='orderSure_fd0_0_c0_c0'  >{{$t('确定订单')}}</text>
</view>
    <view   class='flex flex-wrap align-center orderSure_fd0_0_c2'      >
        </view>
</view>

        </view>
<view :style="{height: (88+StatusBarRpx)+'rpx'}"  ></view>
<!---订单详情flex布局开始-->
 <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout orderSure_flex_1"    >
            <view   class='flex flex-wrap align-center justify-center flex-sub orderSure_fd1_0'   @tap.stop="handleJumpDiy" data-type="navigateTo" :data-url="`/pages/wd/address/address?is_change=1`" v-if= " dataMessage.has_address==0"  >
        <image class='orderSure_fd1_0_c0'  mode="aspectFit"  :src='STATIC_URL+"139.png"'></image>
<text class='orderSure_fd1_0_c1'  >{{$t('添加收货地址')}}</text>
</view>
    <view   class='flex flex-direction flex-wrap align-stretch flex-sub orderSure_fd1_1'   @tap.stop="handleJumpDiy" data-type="navigateTo" :data-url="`/pages/wd/address/address?is_change=1`" v-if= " dataMessage.has_address=='1'"  >
            <view   class='flex flex-wrap align-center orderSure_fd1_1_c0'      >
        <image class='orderSure_fd1_1_c0_c0'  mode="aspectFit"  :src='STATIC_URL+"139.png"'></image>
    <view   class='flex flex-direction flex-wrap align-stretch flex-sub orderSure_fd1_1_c0_c1'      >
            <view   class='flex align-center orderSure_fd1_1_c0_c1_c0'      >
        <text class='orderSure_fd1_1_c0_c1_c0_c0'  >{{dataMessage.address.label_name}}</text>
<text class='orderSure_fd1_1_c0_c1_c0_c1'  >{{dataMessage.address.real_name}}</text>
<text class='orderSure_fd1_1_c0_c1_c0_c2'  >(</text>
<text class='orderSure_fd1_1_c0_c1_c0_c2'    v-if= "dataMessage.address.sex=='1'"  >{{$t('先生')}}</text><text class='orderSure_fd1_1_c0_c1_c0_c2'    v-if= "dataMessage.address.sex!='1'"  >{{$t('女士')}}</text>
<text class='orderSure_fd1_1_c0_c1_c0_c2'  >)</text>
<text class='flex-sub orderSure_fd1_1_c0_c1_c0_c5'  >{{dataMessage.address.mobile}}</text>
</view>
    <view   class='flex align-center'      >
            <view   class='flex flex-wrap align-center flex-sub'      >
            <view   class='orderSure_fd1_1_c0_c1_c1_c0_c0'      >
        <text class='flex-sub orderSure_fd1_1_c0_c1_c1_c0_c0_c0'  >{{dataMessage.address.province}}</text>
<text class='flex-sub orderSure_fd1_1_c0_c1_c1_c0_c0_c0'  >{{dataMessage.address.city}}</text>
<text class='flex-sub orderSure_fd1_1_c0_c1_c1_c0_c0_c0'  >{{dataMessage.address.district}}</text>
<text class='flex-sub orderSure_fd1_1_c0_c1_c1_c0_c0_c0'  >{{dataMessage.address.detail}}</text>
</view>
</view>
</view>
</view>
<image class='self-center orderSure_fd1_1_c0_c2'  mode="aspectFit"  :src='STATIC_URL+"121.png"'></image>
</view>
    <view   class='flex flex-wrap align-center flex-sub'      >
            <view   class='flex flex-wrap align-center flex-sub orderSure_fd1_1_c1_c0'      >
        </view>
</view>
</view>
    <view   class='flex flex-direction flex-wrap align-stretch orderSure_fd1_2'    v-if= "dataMessage.goods_integral"  >
            <view   class='flex flex-wrap align-center orderSure_fd1_2_c0'      >
        <image class='orderSure_fd1_2_c0_c0'  mode="aspectFill"  :src='dataMessage.goods_integral.thumb'  v-if= "coupon=='0'"></image><image class='orderSure_fd1_2_c0_c0'  mode="aspectFill"  :src='dataMessage.goods_integral.thumb'  v-if= "coupon=='1'"></image>
    <view   class='flex flex-direction flex-wrap align-stretch flex-sub orderSure_fd1_2_c0_c1'      >
        <text class='orderSure_fd1_2_c0_c1_c0'  >{{dataMessage.goods_integral.name}}</text>
    <view   class='flex flex-wrap align-center orderSure_fd1_2_c0_c1_c1'      >
        <text class='orderSure_fd1_2_c0_c1_c1_c0'  >{{dataMessage.goods_integral.integral}}</text>
<text class='orderSure_fd1_2_c0_c1_c1_c1'    v-if= "dataMessage.goods_integral.shop_price!='0.00'"  >{{$t('积分+')}}</text><text class='orderSure_fd1_2_c0_c1_c1_c1'    v-if= "dataMessage.goods_integral.shop_price=='0.00'"  >积分</text>
<text class='orderSure_fd1_2_c0_c1_c1_c0'    v-if= "dataMessage.goods_integral.shop_price!='0.00'"  >{{dataMessage.goods_integral.shop_price}}</text>
<text class='orderSure_fd1_2_c0_c1_c1_c1'    v-if= "dataMessage.goods_integral.shop_price!='0.00'"  >元</text>
<text class='orderSure_fd1_2_c0_c1_c1_c4'  >x</text>
<text class='orderSure_fd1_2_c0_c1_c1_c5'  >{{dataMessage.goods_integral.number}}</text>
</view>
</view>
</view>
    <view   class='flex flex-wrap align-center orderSure_fd1_2_c1'      >
        <text class='orderSure_fd1_2_c1_c0'  >{{$t('商品总额')}}</text>
<text class='orderSure_fd1_2_c1_c1'  >￥</text>
<text class='orderSure_fd1_2_c1_c2'  >{{dataMessage.order_money}}</text>
</view>
    <view   class='flex flex-wrap align-center orderSure_fd1_2_c2'      >
        <text class='orderSure_fd1_2_c1_c0'  >{{$t('商品积分(当前积分：')}}</text>
<text class='orderSure_fd1_2_c1_c0'  >{{dataUserInfo.score}}</text>
<text class='orderSure_fd1_2_c1_c0'  >)</text>
<text class='orderSure_fd1_2_c1_c1'  >-</text>
<text class='orderSure_fd1_2_c1_c2'  >{{dataMessage.goods_integral.integral}}</text>
</view>
    <view   class='flex flex-wrap align-center orderSure_fd1_2_c3'      >
        <text class='orderSure_fd1_2_c3_c0'  >{{$t('合计：')}}</text>
<text class='orderSure_fd1_2_c3_c1'  >￥</text>
<text class='orderSure_fd1_2_c3_c2'  >{{dataMessage.payable_money}}</text>
</view>
</view>
    <view   class='flex flex-wrap align-center orderSure_fd1_3'      >
        <text class='orderSure_fd1_3_c0'  >{{$t('合计：')}}</text>
<text class='orderSure_fd1_3_c1'  >￥</text>
<text class='orderSure_fd1_3_c2'  >{{dataMessage.payable_money}}</text>
<button class='orderSure_fd1_3_c3'  @tap.stop="orderPlaceFunc()"  >{{$t('提交订单')}}</button>
</view>
</view>
        
<!---订单详情flex布局结束-->
<benben-popup v-model="popupShow1686109619915" :mask="true" :mask-close-able="false"  mode='center' >
    <!---flex布局flex布局开始-->
 <view class="flex flex-direction align-stretch benben-flex-layout orderSure_flex_2"    >
            <view   class='flex align-center justify-center orderSure_fd2_0'      >
        <text class='orderSure_fd2_0_c0'  >{{status_msg}}</text>
</view>
    <view   class='flex align-center justify-center'      >
        <button class='orderSure_fd2_1_c0'  @tap.stop="backYeFunc()"  >{{$t('返回上一页')}}</button>
<button class='orderSure_fd2_1_c1'  @tap.stop="goAddListFunc()"  >{{$t('切换收货地址')}}</button>
</view>
</view>
        
<!---flex布局flex布局结束-->
    
</benben-popup>
    
    
        </view>
    </view>
</template>
<script>
    import {validate} from '@/common/utils/validate.js'
    
    export default {
        components:{},
        
        
        data(){
			return {"popupShow1686109619915":false,"coupon":"0","dataMessage":{},"sex_name":"","dataDetails":{"order_sn":"","is_pay":""},"status_msg":"","freight_explain":"","liuyan":"","invoiceId":"","username":"","address_id":"223","dataUserInfo":{"invite_code":"","address":"","address_code":"","hobby":"","tags":"","id":"","userlevel_id":"","mobile":"","real_name":"","avatar":"","account":"","email":"","birthday":"","gender":"","create_time":"","user_money":"","freeze_money":"","total_consumption_money":"","score":"","_mobile":"","coupon":"","collection_count":"","browse_count":"","total_money":"","certified":"","nickname":"","is_pay_password":"","follow_count":""},"goods_id":"10","number":"","activity_id":"","sku_id":"","invoice_id":""};
		},
		computed:{
            themeColor() {
              return this.$store.getters.themeColor
            },
            
		},
		watch:{},
		onLoad(options){
            let {goods_id,address_id,number,activity_id,sku_id,invoice_id}=options
if (goods_id !== undefined) this.goods_id = goods_id
if (address_id !== undefined) this.address_id = address_id
if (number !== undefined) this.number = number
if (activity_id !== undefined) this.activity_id = activity_id
if (sku_id !== undefined) this.sku_id = sku_id
if (invoice_id !== undefined) this.invoice_id = invoice_id
this.yesOrderFunc()
this.getUserinfoFunc()
this.diyPageListen()
		},
        onUnload() {
            this.diyOffPageListen()    
        },
		onReady(){
            
		},
		onShow(){
            
		},
		onHide(){
            
		},
		onResize(){
            
		},
		onPullDownRefresh(){
            
		},
		onReachBottom(e){
            
		},
		onPageScroll(e){
            
		},
		methods:{
                            //积分商城-下单
                async orderPlaceFunc(){
                    let datadataDetails = await this.$api.post(global.apiUrls.post641465fa0b5df, {
					goods_id: this.dataMessage.goods_integral.aid,
					address_id: this.address_id,
					number: this.dataMessage.goods_integral.number,
					payable_money: this.dataMessage.payable_money
				});
				if (datadataDetails.data.code != 1) {
					this.$message.info(datadataDetails.data.msg);
					return
				}
				let infodataDetails = datadataDetails.data;
				this.dataDetails = infodataDetails.data
				if (this.dataDetails.is_pay == '0') {//是否需要调起支付:1 是 0 否
					this.$urouter.redirectTo(`/pages/jf/exchangeSuccessful/exchangeSuccessful`);
				}else{
					this.$urouter.redirectTo(
						`/pages/sy/offerPay/offerPay?order_sn=${this.dataDetails.order_sn}&order_type=4`
					);
				}
                },
                //返回上一页
                 backYeFunc(){
                        this.popupShow1685773487026 = false;
            this.$urouter.navigateBack(1);
                },
                //修改收货地址
                 goAddListFunc(){
                        this.popupShow1686109619915 = false;
    this.$urouter.navigateTo(`/pages/wd/address/address?is_change=1`);
                },
                //获取会员详情信息
                async getUserinfoFunc(){
                        //请求方法
    //数据验证
    
  let datadataUserInfo = await this.$api.get(global.apiUrls.post5c78c4772da97, {
    
  });
  
  if (datadataUserInfo.data.code != 1) {
    this.$message.info(datadataUserInfo.data.msg);
    return
  } 
  let infodataUserInfo = datadataUserInfo.data;
  this.dataUserInfo = infodataUserInfo.data
  
                },
                //积分商城-确认订单
                async yesOrderFunc(){
                    let datadataMessage = await this.$api.post(global.apiUrls.post6414631bc7cdf, {
					goods_id: this.goods_id,
					address_id: this.address_id
				});
				if (datadataMessage.data.code != 1) {
					if(datadataMessage.data.code==-1){//code=-1地址超出范围
						this.status_code = -1
						this.status_msg = datadataMessage.data.msg
						this.popupShow1686109619915 = true
						this.dataMessage = datadataMessage.data.data
					}else{
						this.$message.info(datadataMessage.data.msg);
						setTimeout(()=>{
							uni.navigateBack()
						},1000)
					}
					return
				}
				let info = datadataMessage.data.data
				this.dataMessage = info
				//从上个页面如果没有传地址 从详情里取
				this.address_id = this.address_id?this.address_id:info.address.aid||0
                },
    //页面监听
    diyPageListen() {
                  uni.$on('isokaddid',(data) => {
                  this.address_id = data;
                    this.yesOrderFunc()
          });
    }                     ,
    //注销页面监听
    diyOffPageListen() {
                     uni.$off('isokaddid');
    }                     
		}
    };
</script> 
<style lang="scss" scoped>
           .page{
            width: 100vw;
            overflow-x: hidden;
            min-height: calc(100vh - var(--window-bottom));
            background:#F8F8F8;background-size: 100% auto;
        }
    .orderSure_flex_0{
        border-bottom:1px solid #eee;background:#fff;width:750rpx;height:88rpx;overflow:hidden;z-index:10;top:0rpx;background-size:100% auto !important;
    }
    .orderSure_fd0_0_c2{
        width:36rpx;
    }
    .orderSure_fd0_0_c0_c0{
        font-size:36rpx;font-weight:500;color:rgba(51, 51, 51, 1);
    }
    .orderSure_fd0_0{
        margin:0rpx 32rpx 0rpx 32rpx;line-height:88rpx;
    }
    .orderSure_flex_1{
        padding:20rpx 24rpx 0rpx 24rpx;
    }
    .orderSure_fd1_3_c3{
        background:var(--benbenbgColor7);border-radius:0rpx 0rpx 0rpx 0rpx;font-size:28rpx;color:var(--benbenFontColor3);width:260rpx;height:100rpx;line-height:100rpx;font-weight:500;
    }
    .orderSure_fd1_3_c2{
        font-size:28rpx;font-weight:500;color:rgba(250, 32, 51, 1);margin:0rpx auto 0rpx 0rpx;
    }
    .orderSure_fd1_3_c1{
        font-size:20rpx;font-weight:500;color:rgba(250, 32, 51, 1);
    }
    .orderSure_fd1_3_c0{
        margin:0rpx 0rpx 0rpx 24rpx;font-size:28rpx;font-weight:500;color:rgba(51, 51, 51, 1);
    }
    .orderSure_fd1_3{
        background:var(--benbenbgColor1);width:750rpx;height:100rpx;background-size:100% auto !important;position:fixed;left:0rpx;bottom:calc(0rpx + var(--window-bottom));
    }
    .orderSure_fd1_2_c3_c2{
        font-size:28rpx;font-weight:500;color:var(--benbenFontColor7);
    }
    .orderSure_fd1_2_c3_c1{
        font-size:20rpx;font-weight:500;color:var(--benbenFontColor7);
    }
    .orderSure_fd1_2_c3_c0{
        margin:0rpx 0rpx 0rpx auto;font-size:24rpx;font-weight:500;color:rgba(102, 102, 102, 1);
    }
    .orderSure_fd1_2_c3{
        border-top:1px solid #eee;padding:24rpx 0rpx 24rpx 0rpx;
    }
    .orderSure_fd1_2_c2{
        margin:32rpx 0rpx 32rpx 0rpx;
    }
    .orderSure_fd1_2_c1_c2{
        font-size:28rpx;font-weight:500;color:rgba(51, 51, 51, 1);
    }
    .orderSure_fd1_2_c1_c1{
        margin:0rpx 0rpx 0rpx auto;font-size:28rpx;font-weight:500;color:rgba(51, 51, 51, 1);
    }
    .orderSure_fd1_2_c1_c0{
        font-size:28rpx;font-weight:400;color:rgba(51, 51, 51, 1);
    }
    .orderSure_fd1_2_c1{
        margin:32rpx 0rpx 0rpx 0rpx;
    }
    .orderSure_fd1_2_c0_c1_c1_c5{
        font-size:24rpx;font-weight:400;color:rgba(153, 153, 153, 1);
    }
    .orderSure_fd1_2_c0_c1_c1_c4{
        margin:0rpx 0rpx 0rpx auto;font-size:24rpx;font-weight:400;color:rgba(153, 153, 153, 1);
    }
    .orderSure_fd1_2_c0_c1_c1_c1{
        font-size:22rpx;font-weight:400;color:rgba(51, 51, 51, 1);
    }
    .orderSure_fd1_2_c0_c1_c1_c0{
        font-size:36rpx;font-weight:700;color:var(--benbenFontColor0);margin:0rpx 8rpx 0rpx 0rpx;
    }
    .orderSure_fd1_2_c0_c1_c1{
        margin:auto 0rpx 0rpx 0rpx;
    }
    .orderSure_fd1_2_c0_c1_c0{
        font-size:28rpx;font-weight:500;color:rgba(51, 51, 51, 1);margin:0rpx 0rpx 8rpx 0rpx;-webkit-line-clamp:2;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;
    }
    .orderSure_fd1_2_c0_c1{
        height:200rpx;
    }
    .orderSure_fd1_2_c0_c0{
        width:200rpx;height:200rpx;border-radius:16rpx 16rpx 16rpx 16rpx;margin:0rpx 24rpx 0rpx 0rpx;
    }
    .orderSure_fd1_2_c0{
        border-bottom:1px solid #eee;padding:0rpx 0rpx 32rpx 0rpx;
    }
    .orderSure_fd1_2{
        background:#fff;background-size:100% auto !important;border-radius:16rpx 16rpx 16rpx 16rpx;padding:32rpx 24rpx 0rpx 24rpx;margin:20rpx 0rpx 0rpx 0rpx;
    }
    .orderSure_fd1_1_c1_c0{
        background:url(image-path('122.png')) no-repeat ,transparent;height:6rpx;background-size:100% auto !important;
    }
    .orderSure_fd1_1_c0_c2{
        width:12rpx;height:22rpx;margin:8rpx 0rpx 0rpx 32rpx;
    }
    .orderSure_fd1_1_c0_c1_c1_c0_c0_c0{
        line-height:40rpx;font-size:28rpx;font-weight:400;color:#666666;
    }
    .orderSure_fd1_1_c0_c1_c1_c0_c0{
        -webkit-line-clamp:3;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;
    }
    .orderSure_fd1_1_c0_c1_c0_c5{
        line-height:40rpx;font-size:32rpx;font-weight:500;color:#333333;margin:0rpx 0rpx 0rpx 32rpx;-webkit-line-clamp:1;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;
    }
    .orderSure_fd1_1_c0_c1_c0_c2{
        line-height:45rpx;font-size:32rpx;font-weight:700;color:#333333;
    }
    .orderSure_fd1_1_c0_c1_c0_c1{
        line-height:45rpx;font-size:32rpx;font-weight:700;color:#333333;margin:0rpx 0rpx 0rpx 16rpx;max-width:200rpx;-webkit-line-clamp:1;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;
    }
    .orderSure_fd1_1_c0_c1_c0_c0{
        border:1px solid var(--benbenbdColor8);background:var(--benbenbgColor5);padding:0rpx 10rpx 0rpx 10rpx;font-size:24rpx;font-weight:400;color:var(--benbenFontColor4);background-size:100% auto !important;border-radius:4rpx 4rpx 4rpx 4rpx;
    }
    .orderSure_fd1_1_c0_c1_c0{
        margin:0rpx 0rpx 16rpx 0rpx;
    }
    .orderSure_fd1_1_c0_c1{
        margin:0rpx 0rpx 0rpx 32rpx;
    }
    .orderSure_fd1_1_c0_c0{
        width:60rpx;height:60rpx;border-radius:0rpx 0rpx 0rpx 0rpx;
    }
    .orderSure_fd1_1_c0{
        margin:0rpx 32rpx 32rpx 24rpx;
    }
    .orderSure_fd1_1{
        background:#fff;background-size:100% auto !important;padding:32rpx 0rpx 0rpx 0rpx;border-radius:16rpx 16rpx 16rpx 16rpx;
    }
    .orderSure_fd1_0_c1{
        line-height:45rpx;font-size:32rpx;font-weight:700;color:#333333;max-width:200rpx;-webkit-line-clamp:1;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;margin:0rpx 0rpx 0rpx 24rpx;
    }
    .orderSure_fd1_0_c0{
        width:60rpx;height:60rpx;
    }
    .orderSure_fd1_0{
        background:#fff;background-size:100% auto !important;padding:32rpx 0rpx 32rpx 0rpx;border-radius:16rpx 16rpx 16rpx 16rpx;
    }
    .orderSure_flex_2{
        background:var(--benbenbgColor1);background-size:100% auto !important;border-radius:16rpx 16rpx 16rpx 16rpx;width:540rpx;padding:80rpx 24rpx 80rpx 24rpx;
    }
    .orderSure_fd2_1_c1{
        background:var(--benbenbgColor7);font-size:24rpx;color:var(--benbenFontColor3);height:70rpx;padding:0rpx 18rpx 0rpx 18rpx;border-radius:35rpx;line-height:70rpx;margin:0rpx 0rpx 0rpx 20rpx;
    }
    .orderSure_fd2_1_c0{
        border:1px solid var(--benbenbdColor0);background:#EEF5F1;font-size:24rpx;color:var(--benbenFontColor5);height:70rpx;padding:0rpx 18rpx 0rpx 18rpx;border-radius:35rpx;line-height:70rpx;margin:0rpx 20rpx 0rpx 0rpx;
    }
    .orderSure_fd2_0_c0{
        font-size:28rpx;font-weight:400;color:rgba(253, 81, 61, 1);
    }
    .orderSure_fd2_0{
        margin:0rpx 0rpx 46rpx 0rpx;
    }
</style>